   // 获取轮播图数据并创建元素节点
   const bannerServerURL = "https://res.vmallres.com/"
   const imgList = document.querySelector('.images').querySelector('ul');
   let liveActive = document.querySelector('.active');
   const dians = document.querySelector('.dians');
   let dianActive = dians.querySelector('.active');
   for(let i=0;i<banners.length;i++){
       let li = document.createElement('li');
       let img = document.createElement('img');
       img.src = `${bannerServerURL}${banners[i].imgUrl}`;
       li.classList.add('item');
       if(i==0){
           li.classList.remove('item');
           li.classList.add('active');
           liveActive = li;
       };
       li.appendChild(img);
       imgList.appendChild(li);
   }

   // 轮播定时器
   let timer = setInterval(changeImg,4000);
   let index = 0;
   function changeImg(flag){
       flag?index--:index++;
       if(index>=imgList.children.length)index=0;
       if(index<0)index=imgList.children.length-1;
       liveActive.classList.remove('active');
       liveActive.classList.add('item');
       dianActive.classList.remove('active');
       dians.children[index].classList.add('active');
       dianActive = dians.children[index]
       imgList.children[index].classList.add('active');
       imgList.children[index].classList.remove('item');
       imgList.children[index].style.transition = "all 2s";
       liveActive = imgList.children[index];
   }
   // 左右切换按钮
   const left = document.querySelector('.btn-left');
   const right = document.querySelector('.btn-right');
   right.addEventListener('click',function(){
       changeImg()
       clearInterval(timer);
       timer = setInterval(changeImg,4000)
   })
   left.addEventListener('click',function(){
       changeImg(1)
       clearInterval(timer);
       timer = setInterval(changeImg,4000)
   })
   // 轮播图中心点
   for(let i=0;i<banners.length;i++){
       let div = document.createElement('div');
       div.classList.add('d-item');
       div.dataset.index = i;
       if(i==0){
           div.classList.add('active');
           dianActive = div;
       }
       dians.appendChild(div);
   }
   dians.addEventListener('click',function(e){
       if(e.target.classList.contains("d-item")){
           let index2 = e.target.dataset.index;
           index = index2;
           changeImg2();
       }
   })
   function changeImg2(){
       clearInterval(timer);
       if(index>=imgList.children.length)index=0;
       if(index<0)index=imgList.children.length-1;
       liveActive.classList.remove('active');
       liveActive.classList.add('item');
       dianActive.classList.remove('active');
       dians.children[index].classList.add('active');
       dianActive = dians.children[index]
       imgList.children[index].classList.add('active');
       imgList.children[index].classList.remove('item');
       imgList.children[index].style.transition = "all 2s";
       liveActive = imgList.children[index];
       timer = setInterval(changeImg,4000)
   }